{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="{:url('admin/config/navadd')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加菜单</a>
        </div>
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th width="100px">ID</th>
                <th>菜单名称</th>
                <th width="100px">url</th>
                <th width="100px">打开方式</th>
                <th width="100px">排序</th>
                <th width="200px">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach name="list" item="v" empty="$empty"}
            <tr>
                <td>{$v.id}</td>
                <td>{neq name="v.level" value="1"}|{php}for($i=1;$i<$v['level'];$i++){echo ' ----';}{/php}{/neq} {$v.name}</td>
                <th width="100px">{$v.url}</th>
                <th width="100px">{$v.target}</th>
                <td>
                    <input type="text" name="sort_order" value="{$v.sort_order}" autocomplete="off" class="layui-input ajax-update" data-url="{:url('admin/config/navedit', ['id' => $v.id])}">
                </td>
                <td>
                    <a href="{:url('admin/config/navedit', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                    <a href="{:url('admin/config/navdel', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
</div>
{/block}
